﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BF.Model;
using BF.Membership.MembershipEF;
using BF.Membership.BLL;
using BF.Infrastructure;
using System.Linq.Expressions;
using BF.Membership;

namespace BF.IBLL.BaseSystem
{
    public interface Isys_RoleInfoBLL
    {

        /// <summary>
        /// 更具角色名称获取角色对象
        /// </summary>
        /// <param name="roleName"></param>
        /// <returns></returns>
        RoleView GetRoleViewByName(string roleName);

        /// <summary>
        /// 添加角色
        /// </summary>
        /// <param name="role"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        bool AddRole(RoleView roleView, sys_UserInfo user);

        //删除记录角色创建人数据
        bool DeleteRole(Guid roleId);

        /// <summary>
        /// 修改角色
        /// </summary>
        /// <param name="aspnet_Roles"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        bool UpdateRole(RoleView roleView, sys_UserInfo user);

        int GetViewRowCount(Expression<Func<sys_RoleInfo, bool>> where);
        List<RoleView> GetViewList(Expression<Func<sys_RoleInfo, bool>> where, Expression<Func<sys_RoleInfo, object>> orderBy, PageModel pageModel, bool isAscending);

        List<RoleView> GetViewList(Guid userId);

        //根据用户ID获得该用户所创建的所有角色
        List<sys_RoleInfo> GetRoleCreateByUserId(Guid userId);
        //根据RoleID获得角色对象
        aspnet_Roles GetRoleById(Guid roleId);
    }
}
